import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: 'dddd',
    theme: ThemeData(primaryColor: Colors.red),
    home: MyDraw(),
  ));
}

class MyDraw extends StatefulWidget {
  const MyDraw({super.key});

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _myDrawState();
  }
}

class _myDrawState extends State {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: const Text('抽屉菜单'),
      ),
      drawer: Drawer(
          child: ListView(
        children: [
          Container(
            padding: EdgeInsets.only(left: 20, top: 30),
            width: double.infinity,
            height: 200,
            decoration: const BoxDecoration(color: Colors.orange),
            child: const Column(
              // mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Row(
                  children: [
                    CircleAvatar(
                      backgroundImage: NetworkImage(
                        'https://img2.baidu.com/it/u=290531281,2127740042&fm=253&fmt=auto&app=138&f=JPEG?w=372&h=499',
                        scale: 80,
                      ),
                    ),
                    SizedBox(
                      width: 10,
                    ),
                    Text('UDID；87979797987')
                  ],
                ),
                SizedBox(
                  height: 20,
                ),
                Text('姓名是：james'),
              ],
            ),
          ),
          ListTile(
            title: const Text('这里是主页'),
            leading: CircleAvatar(
              backgroundImage: const NetworkImage(
                  'https://img2.baidu.com/it/u=290531281,2127740042&fm=253&fmt=auto&app=138&f=JPEG?w=372&h=499'),
            ),
            onTap: () {
              print('点击主页');
            },
          ),
          const Divider(),
          ListTile(
            title: const Text('设置'),
            leading: CircleAvatar(
              backgroundImage: const NetworkImage(
                  'https://img2.baidu.com/it/u=290531281,2127740042&fm=253&fmt=auto&app=138&f=JPEG?w=372&h=499'),
            ),
            onTap: () {
              print('点击设置');
            },
          ),
        ],
      )),
    );
  }
}
